package logic

import (
	"fmt"

	"mall/service/mqueue/common/types"

	"github.com/hibiken/asynq"
	"github.com/zeromicro/go-zero/core/logx"
)

// scheduler job ------> mall/service/mqueue/job/internal/logic/scanupdatedgorsecacheprocessor.go
func (l *MqueueScheduler) scanUpdatedGorseCache() {
	task := asynq.NewTask(types.ScheduleScanUpdatedGorseCache, nil)
	// every thirty minute exec
	entryId, err := l.svcCtx.Scheduler.Register("10 0 * * *", task)
	if err != nil {
		logx.WithContext(l.ctx).Errorf("!!!MqueueSchedulerErr!!! ====> 【scanUpdatedGorseCache】 registered err: %+v , task: %+v", err, task)
	}

	fmt.Printf("【scanUpdatedGorseCache】 registered an entry: %q \n", entryId)
}
